package Lesson14;

public class Car {
	
	String model;
	int maxSpeed;
	int currentSpeed;
	String color;
	int currentGear;
	Person owner;
	// String ownerOfTheCar = owner.name;
	
	void accelerate()
	{
		currentSpeed += 20;
		if(currentSpeed>=maxSpeed)
		{
			currentSpeed = maxSpeed;	
		}
	}
	void changeGearUp()
	{
		if(currentGear>=6)
		{
			System.out.println("You are on gear 6. There are no more gears!");
		}
		else
			currentGear++;
	}
	void changeGearDown()
	{
		if(currentGear<=1)
		{
			System.out.println("You are on 1st gear. No more gears down!");
		}
		else
			currentGear--;
	}
	void changeGear(int nextGear)
	{
		if(nextGear>=1 && nextGear<=6)
		{
			currentGear = nextGear;
		}
	}
	void changeColor(String newColor)
	{
		color = newColor;
	}

}
